﻿<Window x:Class="W7StyleSample.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=TreeViewEx"
        xmlns:Model="clr-namespace:W7StyleSample.Model" Title="MainWindow" Height="350" Width="261"
        AutomationProperties.Name="TestApp2Window">
    <Window.Resources>
        <HierarchicalDataTemplate ItemsSource="{Binding Children}" DataType="{x:Type Model:Node}">
            <TextBlock Text="{Binding IsVisible}"/>
		</HierarchicalDataTemplate>
        <Style TargetType="{x:Type Controls:TreeViewExItem}" x:Key="visibilityStyle">
            <Setter Property="Visibility" Value="{Binding Visibility}" />
        </Style>
        <Style TargetType="{x:Type Controls:TreeViewExItem}" x:Key="isVisibleStyle">
            <Setter Property="IsVisible" Value="{Binding IsVisible}" />
        </Style>
    </Window.Resources>
    <DockPanel>
        <Controls:TreeViewEx AutomationProperties.Name="TestApp2Tree" ItemsSource="{Binding Path=Children}"
                ItemContainerStyle="{StaticResource visibilityStyle}"/>
		<Controls:TreeViewEx AutomationProperties.Name="TestApp2Tree" ItemsSource="{Binding Path=Children}"
                ItemContainerStyle="{StaticResource isVisibleStyle}" />
    </DockPanel>
</Window>
